import i18n from '@/lang'
import moment from 'moment'
export const softwareManageTbColumns = [
  {
    slots: {
      title: 'noteForSelect'
    },
    key: 'noteForSelect',
    width: 0,
    fixed: 'left'
  },
  {
    // slots: {
    //   title: 'formsId'
    // },
    title: i18n.t('formsId'),
    dataIndex: 'applyNumber',
    key: 'applyNumber',
    width: 250
  },
  {
    title: i18n.t('engineerAcademy'),
    dataIndex: 'serialNo',
    width: 120,
    key: 'serialNo',
    scopedSlots: { customRender: 'serialNo' }
  },
  {
    title: i18n.t('modelCode'),
    dataIndex: 'modelCode',
    width: 120,
    key: 'modelCode'
  },
  {
    title: i18n.t('modelName'),
    dataIndex: 'modelName',
    width: 120,
    key: 'modelName'
  },
  {
    title: i18n.t('ecuName'),
    dataIndex: 'ecuName',
    key: 'ecuName',
    width: 160
  },
  {
    title: i18n.t('versionName'),
    dataIndex: 'versionNumber',
    key: 'versionNumber',
    width: 80
  },
  {
    title: i18n.t('forms') + i18n.t('status'),
    dataIndex: 'applyStatus',
    key: 'applyStatus',
    width: 130,
    scopedSlots: { customRender: 'applyStatus' }
  },
  {
    title: i18n.t('isConfigFile'),
    key: 'isConfigFile',
    dataIndex: 'isConfigFile',
    width: 130,
    scopedSlots: { customRender: 'isConfigFile' }
  },
  {
    title: i18n.t('sjblx'),
    dataIndex: 'upgradePackType',
    key: 'upgradePackType',
    width: 136,
    scopedSlots: { customRender: 'upgradePackType' }
  },
  // {
  //   title: i18n.t('sjzt'),
  //   dataIndex: 'shelveStatus',
  //   key: 'shelveStatus',
  //   width: 136,
  //   scopedSlots: { customRender: 'shelveStatus' }
  // },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 170,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: true
  },
  {
    title: i18n.t('operation'),
    width: 360,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const uploadedFileTableColumns = [
  {
    title: i18n.t('fileName'),
    dataIndex: 'fileName',
    key: 'fileName',
    width:280,
  },
  {
    title: i18n.t('fileSize'),
    dataIndex: 'fileSize',
    key: 'fileSize',
    scopedSlots: { customRender: 'fileSize' }
  },
  {
    title: i18n.t('originalVersion'),
    dataIndex: 'primitiveVersion',
    key: 'primitiveVersion',
    scopedSlots: { customRender: 'primitiveVersion' }
  },
  {
    title: i18n.t('estimatedInstallTime') + '(s)',
    dataIndex: 'installSec',
    key: 'installSec'
  },
  {
    title: i18n.t('timeout') + '(s)',
    key: 'timeoutSec',
    dataIndex: 'timeoutSec'
  },
  {
    title: i18n.t('dllFileClassName'),
    dataIndex: 'fileReprogramType',
    key: 'fileReprogramType',
    scopedSlots: { customRender: 'fileReprogramType' }
  },
  {
    title: i18n.t('zysf'),
    dataIndex: 'hashAlgorithm',
    key: 'hashAlgorithm',
    scopedSlots: { customRender: 'hashAlgorithm' }
  },
  {
    title: i18n.t('zyz'),
    dataIndex: 'checksum',
    key: 'checksum',
    scopedSlots: { customRender: 'checksum' }
  },
  {
    title: i18n.t('operation'),
    width: 160,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const uploadedFileTableColumnsNoAct = [
  {
    title: i18n.t('fileName'),
    dataIndex: 'fileName',
    key: 'fileName',
    width:280
  },
  {
    title: i18n.t('fileSize'),
    dataIndex: 'fileSize',
    key: 'fileSize'
  },
  {
    title: i18n.t('fileStatus'),
    dataIndex: 'fileUploadStatusName',
    key: 'fileUploadStatusName',
    scopedSlots: { customRender: 'fileUploadStatusName' }
  },
  {
    title: i18n.t('originalVersion'),
    dataIndex: 'primitiveVersion',
    key: 'primitiveVersion',
    scopedSlots: { customRender: 'primitiveVersion' }
  },
  {
    title: i18n.t('estimatedInstallTime') + '(s)',
    dataIndex: 'installSec',
    key: 'installSec'
  },
  {
    title: i18n.t('timeout') + '(s)',
    key: 'timeoutSec',
    dataIndex: 'timeoutSec'
  },
  {
    title: i18n.t('dllFileClassName'),
    dataIndex: 'fileReprogramType',
    key: 'fileReprogramType',
    scopedSlots: { customRender: 'fileReprogramType' }
  },
  {
    title: i18n.t('zysf'),
    dataIndex: 'hashAlgorithm',
    key: 'hashAlgorithm',
    scopedSlots: { customRender: 'hashAlgorithm' }
  },
  {
    title: i18n.t('zyz'),
    dataIndex: 'checksum',
    key: 'checksum',
    scopedSlots: { customRender: 'checksum' }
  },
  {
    title: i18n.t('operation'),
    width: 110,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]

export const uploadedFileTableColumnsNoActDraft = [
  {
    title: i18n.t('fileName'),
    dataIndex: 'fileName',
    key: 'fileName',
    width:280
  },
  {
    title: i18n.t('fileSize'),
    dataIndex: 'fileSize',
    key: 'fileSize'
  },
  {
    title: i18n.t('fileStatus'),
    dataIndex: 'fileUploadStatusName',
    key: 'fileUploadStatusName',
    width: 160,
    scopedSlots: { customRender: 'fileUploadStatusName' }
  },
  {
    title: i18n.t('originalVersion'),
    dataIndex: 'primitiveVersion',
    key: 'primitiveVersion',
    scopedSlots: { customRender: 'primitiveVersion' }
  },
  {
    title: i18n.t('estimatedInstallTime') + '(s)',
    dataIndex: 'installSec',
    key: 'installSec'
  },
  {
    title: i18n.t('timeout') + '(s)',
    key: 'timeoutSec',
    dataIndex: 'timeoutSec'
  },
  {
    title: i18n.t('dllFileClassName') ,
    dataIndex: 'fileReprogramType',
    key: 'fileReprogramType',
    scopedSlots: { customRender: 'fileReprogramType' }
  },
  {
    title: i18n.t('zysf'),
    dataIndex: 'hashAlgorithm',
    key: 'hashAlgorithm',
    scopedSlots: { customRender: 'hashAlgorithm' }
  },
  {
    title: i18n.t('zyz'),
    dataIndex: 'checksum',
    key: 'checksum',
    scopedSlots: { customRender: 'checksum' }
  },
  {
    title: i18n.t('operation'),
    width: 110,
    fixed: 'right',
    key: 'operation',
    scopedSlots: { customRender: 'operation' }
  }
]
export const mainProgramTbColumns = [
  {
    title: i18n.t('formsId'),
    dataIndex: 'applyNumber',
    key: 'applyNumber',
    width: 160
  },
  {
    title: i18n.t('vehicleModel'),
    dataIndex: 'modelCode',
    width: 120,
    key: 'modelCode'
  },
  {
    title: i18n.t('ECU'),
    dataIndex: 'ecuName',
    key: 'ecuName',
    width: 160
  },
  {
    title: i18n.t('softwareCoding'),
    dataIndex: 'softwareCode',
    key: 'softwareCode',
    width: 80
  },
  {
    title: i18n.t('versionName'),
    dataIndex: 'versionNumber',
    key: 'versionNumber',
    width: 80
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 190,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: (a, b) => moment(a.createTime) - moment(b.createTime),
  }
]
export const targetVersionColumns = [
  {
    title: i18n.t('formsId'),
    dataIndex: 'applyNumber',
    key: 'applyNumber',
  },
  {
    title: i18n.t('versionName'),
    dataIndex: 'versionNumber',
    key: 'versionNumber',
  },
  // 车型代码
  {
    title: i18n.t('modelCode'),
    dataIndex: 'modelCode',
    key: 'modelCode',
  },
  // 车型名称
  {
    title: i18n.t('modelName'),
    dataIndex: 'modelName',
    key: 'modelName',
  },
   // ECU名称
   {
    title: i18n.t('ecuName'),
    dataIndex: 'ecuName',
    key: 'ecuName',
  },
  // 工程院编号
  {
    title: i18n.t('engineerAcademy'),
    dataIndex: 'serialNo',
    key: 'serialNo',
    align: 'center',
    scopedSlots: { customRender: 'serialNo' }
  },
]
export const mainProgramTbColumnsSelected = [
  {
    title: i18n.t('formsId'),
    dataIndex: 'applyNumber',
    key: 'applyNumber',
    width: 160
  },
  {
    title: i18n.t('vehicleModel'),
    dataIndex: 'modelCode',
    width: 120,
    key: 'modelCode'
  },
  {
    title: i18n.t('ECU'),
    dataIndex: 'ecuName',
    key: 'ecuName',
    width: 160
  },
  {
    title: i18n.t('softwareCoding'),
    dataIndex: 'softwareCode',
    key: 'softwareCode',
    width: 80
  },
  {
    title: i18n.t('versionName'),
    dataIndex: 'versionNumber',
    key: 'versionNumber',
    width: 80
  },
  {
    title: i18n.t('timeOfCreation'),
    dataIndex: 'createTime',
    width: 190,
    key: 'createTime',
    scopedSlots: { customRender: 'createTime' },
    sorter: (a, b) => moment(a.createTime) - moment(b.createTime),
  },
  {
    slots: {
      title: 'bulkDeletion'
    },
    dataIndex: 'operation',
    width: 100,
    scopedSlots: { customRender: 'operation' }
  }
]
export const softwareChangeColumns = [
  {
    title: i18n.t('softwareNumber'),
    dataIndex: 'serialNo',
    width:65,
    key: 'serialNo',
   customRender:(text,record,index)=>`${index+1}`
  },
  {
    title: i18n.t('beforeChange'),
    dataIndex: 'changeBefore',
    key: 'changeBefore',
    width:140,
    scopedSlots: { customRender: 'beforeChange' }
  },
  {
    title: i18n.t('afterChange'),
    dataIndex: 'inflectContent',
    key: 'inflectContent',
    width:140,
    scopedSlots: { customRender: 'afterChange' }
  },
  {
    title: i18n.t('functionalPrinciple'),
    dataIndex: 'function',
    key: 'function',
    width:140,
    scopedSlots: { customRender: 'functionalPrinciple' }
  },
  {
    title: i18n.t('influence'),
    dataIndex: 'affect',
    key: 'affect',
    width:140,
    scopedSlots: { customRender: 'influence' }
  },
  {
    title: i18n.t('changeOfPurpose'),
    dataIndex: 'purpose',
    key: 'purpose',
    width:140,
    scopedSlots: { customRender: 'changeOfPurpose' }
  },
  {
    title: i18n.t('changeAttribute'),
    dataIndex: 'property',
    key: 'property',
    width:140,
    scopedSlots: { customRender: 'changeAttribute' }
  },
  {
    title: i18n.t('problemLevel'),
    dataIndex: 'questionLevel',
    key: 'questionLevel',
    width:120,
    scopedSlots: { customRender: 'problemLevel' }
  },
  {
    title: i18n.t('operation'),
    dataIndex: 'operation',
    width:100,
    scopedSlots: { customRender: 'operation' },
  }
]
export const attachmentColumns= [
  {
    title: i18n.t('附件信息'),
    dataIndex: 'inflectContent'
  },
]
export const softwareChangeDetailColumns = [
  {
    title: i18n.t('softwareNumber'),
    dataIndex: 'serialNo',
    width:80,
    key: 'serialNo',
   customRender:(text,record,index)=>`${index+1}`
  },
  {
    title: i18n.t('beforeChange'),
    dataIndex: 'changeBefore',
    key: 'changeBefore',
    scopedSlots: { customRender: 'beforeChange' }
  },
  {
    title: i18n.t('afterChange'),
    dataIndex: 'inflectContent',
    key: 'inflectContent',
    scopedSlots: { customRender: 'afterChange' }
  },
  {
    title: i18n.t('functionalPrinciple'),
    dataIndex: 'function',
    key: 'function',
    scopedSlots: { customRender: 'functionalPrinciple' }
  },
  {
    title: i18n.t('influence'),
    dataIndex: 'affect',
    key: 'affect',
    scopedSlots: { customRender: 'influence' }
  },
  {
    title: i18n.t('changeOfPurpose'),
    dataIndex: 'purpose',
    key: 'purpose',
    scopedSlots: { customRender: 'changeOfPurpose' }
  },
  {
    title: i18n.t('changeAttribute'),
    dataIndex: 'property',
    key: 'property',
    width:140,
    scopedSlots: { customRender: 'changeAttribute' }
  },
  {
    title: i18n.t('problemLevel'),
    dataIndex: 'questionLevel',
    key: 'questionLevel',
    width:120,
    scopedSlots: { customRender: 'problemLevel' }
  },
]
export const formsStatusArr = [
  {
    value: 10,
    name: i18n.t('wjjgz')
  },
  {
    value: 20,
    name: i18n.t('wjjgsb')
  },
  // {
  //   value: 30,
  //   name: i18n.t('dfqsp')
  // },
  {
    value: 40,
    name: i18n.t('reviewing')
  },
  // {
  //   value: 50,
  //   name: i18n.t('passed')
  // },
  {
    value: 60,
    name: i18n.t('rejected')
  },
  {
    value: 70,
    name: i18n.t('canceled2')
  },
  {
    value: 80,
    name: i18n.t('fqspsb')
  },
  {
    value: 90,
    name: i18n.t('synchronFailure')
  },
  {
    value: 100,
    name: i18n.t('abolished')
  },
  {
    value: 110,
    name: i18n.t('onshelfed')
  },
  {
    value: 120,
    name: i18n.t('offshelfed')
  },
  {
    value: 130,
    name: i18n.t('requestTimeout')
  },
  // {
  //   value: 140,
  //   name: i18n.t('formException')
  // }
]
export const yesOrNoEnumArr = [
  { value: 0, name: i18n.t('no') },
  { value: 1, name: i18n.t('yes') }
]
export const yesOrNoEnumArrString = [
  { value: '0', name: i18n.t('no') },
  { value: '1', name: i18n.t('yes') }
]
export const flushTypeEnumArr = [
  { value: 1, name: 'OTA升级' },
  { value: 2, name: 'VDS烧写' },
  { value: 3, name: 'U盘' },
  { value: 4, name: 'SD卡烧写' },
  { value: 5, name: '仿真烧写' },
  { value: 6, name: '以太网烧写' }
]
export const flushTypeEnumArr3 = [
  { value: 1, name: 'OTA升级' }
]
export const updateFileTypeEnumArr = [
  { value: 1, name: '全包' },
  { value: 2, name: '差分包' }
]
export const softwareDistributionScopeEnumArr = [
  { value: '1', name: '生产发布' },
  { value: '2', name: '售后发布' },
  { value: '3', name: '总装试装' },
  { value: '4', name: 'OTA发布' }
]
export const changeAttributeEnumArr = [
  { value: '1', name: 'BUG修复' },
  { value: '2', name: '性能优化' },
  { value: '3', name: '功能新增' },
  { value: '4', name: '首次导入' }
]
export const problemLevelEnumArr = [
  { value: '1', name: 'S' },
  { value: '2', name: 'A' },
  { value: '3', name: 'B' },
  { value: '4', name: 'C' }
]
export const degreeOfUrgencyEnumArr = [
  { value: 0, name: '一般' },
  { value: 1, name: '紧急' },
 
]
export const userPerceptionEnumArr = [
  { value: 0, name: '用户不感知' },
  { value: 1, name: '用户感知' },
 
]
export const stateSummaryEnumArr = [
  { value: '1', name: '通过' },
  { value: '2', name: '带风险通过' },
  { value: '3', name: '未通过' }
]
export const passOrNot = [
  { value: '1', name: '通过' },
  { value: '2', name: '未通过' }
]
export const flushTypeEnumArr2 = [
  { value: 1, name: '主程序xcd' },
  { value: 2, name: '主程序pcd' },
  { value: 3, name: '主程序wdct' },
  { value: 4, name: '主程序zip' },
  { value: 5, name: '标定文件xml' },
  { value: 6, name: '标定文件zip' }
]
